package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type BrandRequest struct {
	Name      string `form:"name" json:"name"`
	ShortName string `form:"short_name" json:"short_name"`
	Status    int    `form:"status" json:"status"`
	Pinyin    string `form:"pinyin" json:"pinyin"`
	Logo      string `form:"logo" json:"logo"`
	Remark    string `form:"remark" json:"remark"`
}

func (r *BrandRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *BrandRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{
		"Name":      "required",
		"ShortName": "required",
		"Status":    "required",
		"Pinyin":    "required",
	}
}

func (r *BrandRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{
		"Name.required":      "品牌名称不能为空",
		"ShortName.required": "品牌简称不能为空",
		"Status.required":    "品牌状态不能为空",
		"Pinyin.required":    "品牌拼音不能为空",
	}
}

func (r *BrandRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *BrandRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
